Skip to main content

ViewPage<T>

Assembly: ServiceStack.Mvc.dll
View Source
Declaration
public abstract class ViewPage<T> : RazorPage<T>

Properties

Request

View Source
Declaration
public IHttpRequest Request { get; }

Response

View Source
Declaration
public IHttpResponse Response { get; }

IsError

View Source
Declaration
public bool IsError { get; }

ModelError

View Source
Declaration
public object ModelError { get; set; }

IsPostBack

View Source
Declaration
public bool IsPostBack { get; }

PathBase

View Source
Declaration
public string PathBase { get; }

VirtualFiles

View Source
Declaration
public IVirtualFiles VirtualFiles { get; }

VirtualFileSources

View Source
Declaration
public IVirtualPathProvider VirtualFileSources { get; }

AppHost

View Source
Declaration
public IAppHost AppHost { get; }

DebugMode

View Source
Declaration
public bool DebugMode { get; }

ServiceStackProvider

View Source
Declaration
public virtual IServiceStackProvider ServiceStackProvider { get; }

AppSettings

View Source
Declaration
public virtual IAppSettings AppSettings { get; }

ServiceStackRequest

View Source
Declaration
public virtual IHttpRequest ServiceStackRequest { get; }

ServiceStackResponse

View Source
Declaration
public virtual IHttpResponse ServiceStackResponse { get; }

Cache

View Source
Declaration
public virtual ICacheClient Cache { get; }

CacheAsync

View Source
Declaration
public virtual ICacheClientAsync CacheAsync { get; }

Db

View Source
Declaration
public virtual IDbConnection Db { get; }

Redis

View Source
Declaration
public virtual IRedisClient Redis { get; }

MessageProducer

View Source
Declaration
public virtual IMessageProducer MessageProducer { get; }

AuthRepository

View Source
Declaration
public virtual IAuthRepository AuthRepository { get; }

AuthRepositoryAsync

View Source
Declaration
public virtual IAuthRepositoryAsync AuthRepositoryAsync { get; }

SessionFactory

View Source
Declaration
public virtual ISessionFactory SessionFactory { get; }

SessionBag

View Source
Declaration
public virtual ISession SessionBag { get; }

SessionBagAsync

View Source
Declaration
public virtual ISessionAsync SessionBagAsync { get; }

IsAuthenticated

View Source
Declaration
public virtual bool IsAuthenticated { get; }

UserSession

View Source
Declaration
public virtual IAuthSession UserSession { get; }

Gateway

View Source
Declaration
public virtual IServiceGateway Gateway { get; }

Methods

GetLayout(String)

View Source
Declaration
public string GetLayout(string defaultLayout)
Returns

System.String

Parameters
TypeName
System.StringdefaultLayout

GetErrorStatus()

View Source
Declaration
public ResponseStatus GetErrorStatus()
Returns

ServiceStack.ResponseStatus

GetErrorMessage()

View Source
Declaration
public HtmlString GetErrorMessage()
Returns

HtmlString

GetAbsoluteUrl(String)

View Source
Declaration
public HtmlString GetAbsoluteUrl(string virtualPath)
Returns

HtmlString

Parameters
TypeName
System.StringvirtualPath

ApplyRequestFilters(Object)

View Source
Declaration
public void ApplyRequestFilters(object requestDto)
Parameters
TypeName
System.ObjectrequestDto

GetErrorHtml()

View Source
Declaration
public HtmlString GetErrorHtml()
Returns

HtmlString

GetPlugin<TPlugin>()

View Source
Declaration
public virtual TPlugin GetPlugin<TPlugin>()
where TPlugin : class, IPlugin
Returns

<TPlugin>

Type Parameters
  • TPlugin

GetRedisAsync()

View Source
Declaration
public virtual ValueTask<IRedisClientAsync> GetRedisAsync()
Returns

ValueTask<ServiceStack.Redis.IRedisClientAsync>

GetSession(Boolean)

View Source
Declaration
public virtual IAuthSession GetSession(bool reload = false)
Returns

ServiceStack.Auth.IAuthSession

Parameters
TypeName
System.Booleanreload

GetSessionAsync(Boolean, CancellationToken)

View Source
Declaration
public virtual Task<IAuthSession> GetSessionAsync(bool reload = false, CancellationToken token = null)
Returns

Task<ServiceStack.Auth.IAuthSession>

Parameters
TypeName
System.Booleanreload
CancellationTokentoken

SessionAs<TUserSession>()

View Source
Declaration
public virtual TUserSession SessionAs<TUserSession>()
Returns

<TUserSession>

Type Parameters
  • TUserSession

SessionAsAsync<TUserSession>(CancellationToken)

View Source
Declaration
public virtual Task<TUserSession> SessionAsAsync<TUserSession>(CancellationToken token = null)
Returns

Task<<TUserSession>>

Parameters
TypeName
CancellationTokentoken
Type Parameters
  • TUserSession

SaveSession(IAuthSession, Nullable<TimeSpan>)

View Source
Declaration
protected virtual void SaveSession(IAuthSession session, TimeSpan? expiresIn = null)
Parameters
TypeName
ServiceStack.Auth.IAuthSessionsession
System.Nullable<TimeSpan>expiresIn

SaveSessionAsync(IAuthSession, Nullable<TimeSpan>, CancellationToken)

View Source
Declaration
public virtual Task SaveSessionAsync(IAuthSession session, TimeSpan? expiresIn = null, CancellationToken token = null)
Returns

Task

Parameters
TypeName
ServiceStack.Auth.IAuthSessionsession
System.Nullable<TimeSpan>expiresIn
CancellationTokentoken

ClearSession()

View Source
Declaration
public virtual void ClearSession()

ClearSessionAsync(CancellationToken)

View Source
Declaration
public virtual Task ClearSessionAsync(CancellationToken token = null)
Returns

Task

Parameters
TypeName
CancellationTokentoken

TryResolve<TDependency>()

View Source
Declaration
public virtual TDependency TryResolve<TDependency>()
Returns

<TDependency>

Type Parameters
  • TDependency

ResolveService<TService>()

View Source
Declaration
public virtual TService ResolveService<TService>()
Returns

<TService>

Type Parameters
  • TService

ForwardRequestToServiceStack(IRequest)

View Source
Declaration
public virtual object ForwardRequestToServiceStack(IRequest request = null)
Returns

System.Object

Parameters
TypeName
ServiceStack.Web.IRequestrequest

Dispose()

View Source
Declaration
public void Dispose()

EndServiceStackRequest()

View Source
Declaration
public virtual void EndServiceStackRequest()

RenderErrorIfAny()

View Source
Declaration
public bool RenderErrorIfAny()
Returns

System.Boolean

RedirectIfNotAuthenticated(String)

View Source
Declaration
public void RedirectIfNotAuthenticated(string redirect = null)
Parameters
TypeName
System.Stringredirect

RedirectToAsync(String)

View Source
Declaration
public Task RedirectToAsync(string path)
Returns

Task

Parameters
TypeName
System.Stringpath

RedirectTo(String)

View Source
Declaration
public HtmlString RedirectTo(string path)
Returns

HtmlString

Parameters
TypeName
System.Stringpath

AssertRole(String, String, String)

View Source
Declaration
public HtmlString AssertRole(string role, string message = null, string redirect = null)
Returns

HtmlString

Parameters
TypeName
System.Stringrole
System.Stringmessage
System.Stringredirect

AssertRoleAsync(String, String, String)

View Source
Declaration
public Task AssertRoleAsync(string role, string message = null, string redirect = null)
Returns

Task

Parameters
TypeName
System.Stringrole
System.Stringmessage
System.Stringredirect

AssertPermission(String, String, String)

View Source
Declaration
public HtmlString AssertPermission(string permission, string message = null, string redirect = null)
Returns

HtmlString

Parameters
TypeName
System.Stringpermission
System.Stringmessage
System.Stringredirect

AssertPermissionAsync(String, String, String)

View Source
Declaration
public Task AssertPermissionAsync(string permission, string message = null, string redirect = null)
Returns

Task

Parameters
TypeName
System.Stringpermission
System.Stringmessage
System.Stringredirect

Implements

  • IDisposable